<!DOCTYPE HTML>

<html lang="pt-br"  
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
<ui:composition template="/view/Principal.xhtml">
<ui:define name="corpo">
<style type="text/css">
.form-signin 
{
	max-width: 330px;
	padding: 19px 29px 29px;
    margin: 0 auto 20px;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    -webkit-border-radius: 5px;
    	-moz-border-radius: 5px;
        	border-radius: 5px;
    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
    	-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
        	box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
</style>
<div class="container">
	<h:form id="form" class="form-signin">
		<p:growl id="mensagem" 
				showDetail="true" 
				sticky="true" />
		
		<h3 class="form-signin-heading">Alterar Senha</h3>
				
				<div class="control-group">
					<div class="controls">
						<p:inputText id="inputLogin"
								readonly="true"
								value="#{usuarioLogado.login}" 
								styleClass="input-block-level"
								validatorMessage="Formato de login inválido."
								maxlength="20">
							<f:validateRegex pattern="[A-Za-z]{4,30}"/>
						</p:inputText>
						<p:watermark value="Login" 
									for="inputLogin"/>
					</div>
				</div>
				
				<div class="control-group">
					<div class="controls">
						<p:password id="inputSenha" 
								required="true" 
								requiredMessage="Informe a senha."
								value="#{usuarioLogado.senha}" 
								match="inputConfSenha"
								validatorMessage="Senha e confirmação de senha devem ser iguais."
								label="Senha"
								styleClass="input-block-level"
								maxlength="20"/>
						<p:watermark value="Senha" 
									for="inputSenha"/>
					</div>
				</div>
				
				<div class="control-group">
					<div class="controls">
						<p:password id="inputConfSenha" 
								required="true" 
								requiredMessage="Informe a confirmação de senha." 
								value="#{usuarioLogado.senha}" 
								label="Confirmação de senha"
								styleClass="input-block-level"
								maxlength="20"/>
						<p:watermark value="Confirmação de senha" 
									for="inputConfSenha"/>
					</div>
				</div>
		
				<div class="control-group">		
					<p:commandButton id="btnAlterar" 
									value="Alterar" 
									styleClass="btn btn-block btn-info" 
									actionListener="#{usuarioManagerBean.alterarSenha}" 
									update="mensagem"/>
				</div>
	</h:form>
</div>


</ui:define>
</ui:composition>
</html>